Figure out if there is selection in my simulation

The goal of this markdown is to read and think about selection coefficients. What really is a selection coefficient? How can it be measured? What is considered strong and/or weak? How do I pull it out of my simulation (can there be different selection coefficients for different types of selection)? What kind of math is behind it? How might it change in different simulations, like would it get stronger with more interaction? Does it change in different generations?

To go about solving this problem I am reading part of the quantitative genetics book by Caballero. My goal is to find the response to selection. Typically the response to selection can be found by measuring how much the phenotype has changed, but there is also drift in my simulation (which theoretically can be moving the pehotypes around). So I specifically ask how much is selection moving things around? This is really a two part problem, first I need to find the correlation between fitness and phenotype (beta) for small sections, but then what does this correlation mean and how is it related to selection (possibly sel. coef. = cor/h^2)? To accomplish this I will work on it in two parts. Fist, I will try to calculate beta over small sections. Second, I will try to make a no-space simulation with a fixed phenotype for snakes or newts allow one to evolve and use theory to predict how much the mean phenotype should shift (easier said than done…).

Currently, I measure selection with the variable beta. Beta is the correlation between phenotype and an individuals fitnessScaling. However, in my simulation there are two possible selective forces 1) the interaction between newts and snakes and 2) the density dependent selection. Now in no space simulation there is still both types of selection, but the density dependent selection is more like a K value.

What I would like to do:

-run a simulation where newts have an advantage (run msprime with under 5 var and under 2 var) -turn off mutations for newts -see if snake beta goes up <-prediction -watch newt beta <- I think it might stay around 0 -print beta every generation -compare space to no space -manually make one phenotype higher by adding a value

(pairs) sigma_u2=( 0.1 0.2 0.3) mu_rate_u2=( 1e-10 2.5e-11 1.11e-11) sigma_u5=( 0.1 0.2 0.3) mu_rate_u5=( 6.25e-10 1.56e-10 6.94e-11)

Testing for Selection

This is how I would like one of the phenotypes to look if there was an advantage. I was trying to use Msprime to get this type of distribution, but it wasn’t working.

Msprime simulations

Msprime runs the simulation back in time to a coalescent point. Then it assigns mutations with SD()=theta. These mutations have an effect on a phenotype (resistance/toxicity) that are normally distributed around 0. Then the distribution under goes a log transformation, which centers it around 1. When I change the mu and sigma parameters I really change the normal distribution curve. I want to give either the newt or snake a phenotype advantage, the msprime simulation is not the place to do it (as its 11/08/2021 form). I can instead use the slim simulation to give newts or snakes a higher fitness by adding to their phenotype.

Space

I wonder what happens to the phenotype distributions when I change mutation rate and mutation effect sizes (Maybe try different ones out and look at it through slim?).

Quant Gen book

Heritability and genetic correlation page 54 might be more info in ch 9

NoSpace Selection Experiment

Peter and I talked through a selection experiment in the nospace slimulation. We decided that newts’ toxicity would be able to mutate and coevolve with to the snakes resistance (snakes phenotype is set to a value and unable to mutate). I picked parameters that would (hopefully) cause the newts toxicity phenotype to evolve quickly. I also tried increasing interaction rate and moving the snake resistant phenotype further or closer to the newt mean phenotype.

I want to look at the newts’ phenotype, fitness, and its ability to survive (based on phenotype) throughout the generations. Sometimes I get extreme newt phenotypes if the mutation rate is too high. In every simulation where newts became more toxic than snakes there was some competition between snakes and newts where snakes were eating any newt. Then newts and snakes were killing each other. Finally, newts were killing any snake that they met. The transition between newts being eaten by snakes to newts and snakes were killing each other took more time (generations) then when newt became more toxic than snakes.